class BankAccount:
    def __init__(self, account_number, account_holder, balance=0):
        self.account_number = account_number
        self.account_holder = account_holder
        self.balance = balance

    def deposit(self, amount):
        if amount > 0:
            self.balance += amount
            print(f"Deposited ${amount}. New balance is ${self.balance}.")
        else:
            print("Invalid deposit amount.")

    def withdraw(self, amount):
        if 0 < amount <= self.balance:
            self.balance -= amount
            print(f"Withdrew ${amount}. New balance is ${self.balance}.")
        else:
            print("Invalid or insufficient funds for withdrawal.")

    def get_balance(self):
        return self.balance

    def __str__(self):
        # 返回一个易于阅读的字符串表示
        return f"BankAccount({self.account_number}, {self.account_holder}, Balance: ${self.balance:.2f})"

class Customer:
    def __init__(self, name, email):
        self.name = name
        self.email = email
        self.accounts = []

    def add_account(self, account):
        self.accounts.append(account)

    def get_accounts(self):
        return self.accounts

    def __str__(self):
        # 返回一个易于阅读的字符串表示
        accounts_info = ", ".join(str(account) for account in self.accounts)
        return f"Customer: {self.name}, Email: {self.email}, Accounts: [{accounts_info}]"

# 创建客户和账户
john_doe = Customer("John Doe", "johndoe@example.com")
johns_account = BankAccount("123456789", "John Doe", 1000)

# 客户添加账户
john_doe.add_account(johns_account)

# 存款
johns_account.deposit(500)

# 取款
johns_account.withdraw(200)

# 打印客户信息和账户信息
print(john_doe)
print(johns_account)